//图片的懒加载

$(function() {
	$("img").lazyload({
		effect: "fadeIn",
		container: $(".content"),
		failure_limit: 10

	});
})
//脚部选项卡部分
function footcut() {
	
	var footgimc = document.querySelector(".footgimc");
	var footarticle = document.querySelector(".footarticle");
	
	var Ggime_page = document.querySelector(".Ggime_page");
	var content = document.querySelector(".content");
	var article_content = document.querySelector(".article_content");
	
	isNew = true
	var isBlock=false
	footgimc.addEventListener("click", function() {
		
		if(!isBlock){
			content.style.display = "none";
		Ggime_page.style.display = "block";
		isBlock=true;
		}
		else{

			article_content.style.display= "none"
			isBlock=false
		}
		if(isNew) {
			new lunbo(".gime_carousel_wrap", 360 / 640);
			isNew = false;
		}
		
	});

	footarticle.addEventListener("click", function() {
		
		
		if(!isBlock){
			content.style.display = "none";
		Ggime_page.style.display = "none";
		article_content.style.display = "block";
		isBlock=true;
		
		}
		else{
			
//			article_content.style.display = "none";
			isBlock=false;
		}
		if(isNew) {
			new lunbo(".article_carousel", 360 / 640);
			isNew = false;
		}
		
	});
	
}
footcut();

//顶部弹出登录页
function tabs() {
	var closelogin = document.querySelector(".closelogin");
	var login = document.querySelector(".login");
	var isBlock = false;
	closelogin.addEventListener("click", function() {
		if(!isBlock) {
			login.style.transform = "translateX(0%)"
			isBlock = true;
		} else {
			login.style.transform = "translateX(-100%)"
			isBlock = false;
		}
	})
}
tabs();
//关闭登录页
function off() {
	//1获取元素
	var off_login = document.querySelector(".off_login");
	var login = document.querySelector(".login");
	var web = document.querySelector(".web");

	var isBlock = false;
	//2.添加事件（点击，鼠标）
	off_login.addEventListener("click", function() {
		if(!isBlock) {
			//3.控制样式

			login.style.display = "none";
			web.style.display = "block";

		}
	})
}
off();

//点击注册
function registercut() {
	var by_login = document.querySelector(".by_login");
	var zhuce = document.querySelector(".zhuce");
	var web = document.querySelector(".web");
	var go_login = document.querySelector(".by_login");
	var user_box = document.querySelector(".user_box");
	var login = document.querySelector(".user_box");

	by_login.addEventListener("click", function() {
		//		web.style.display = "none";
		zhuce.style.display = "block";
		login.style.display = "none";
	})

}
registercut();